Optimal. Leaf size=114 \[ \frac {2 b \csc (c+d x)}{a^3 d}-\frac {\csc ^2(c+d x)}{2 a^2 d}-\frac {\left (a^2-3 b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {\left (a^2-3 b^2\right ) \log (a+b \sin (c+d x))}{a^4 d}-\frac {a^2-b^2}{a^3 d (a+b \sin (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2800, 908}
\begin {gather*} \frac {2 b \csc (c+d x)}{a^3 d}-\frac {\csc ^2(c+d x)}{2 a^2 d}-\frac {\left (a^2-3 b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {\left (a^2-3 b^2\right ) \log (a+b \sin (c+d x))}{a^4 d}-\frac {a^2-b^2}{a^3 d (a+b \sin (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 908
Rule 2800
Rubi steps
\begin {align*} \int \frac {\cot ^3(c+d x)}{(a+b \sin (c+d x))^2} \, dx &=\frac {\text {Subst}\left (\int \frac {b^2-x^2}{x^3 (a+x)^2} \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \left (\frac {b^2}{a^2 x^3}-\frac {2 b^2}{a^3 x^2}+\frac {-a^2+3 b^2}{a^4 x}+\frac {a^2-b^2}{a^3 (a+x)^2}+\frac {a^2-3 b^2}{a^4 (a+x)}\right ) \, dx,x,b \sin (c+d x)\right )}{d}\\ &=\frac {2 b \csc (c+d x)}{a^3 d}-\frac {\csc ^2(c+d x)}{2 a^2 d}-\frac {\left (a^2-3 b^2\right ) \log (\sin (c+d x))}{a^4 d}+\frac {\left (a^2-3 b^2\right ) \log (a+b \sin (c+d x))}{a^4 d}-\frac {a^2-b^2}{a^3 d (a+b \sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.42, size = 96, normalized size = 0.84 \begin {gather*} -\frac {-4 a b \csc (c+d x)+a^2 \csc ^2(c+d x)+2 \left (a^2-3 b^2\right ) \log (\sin (c+d x))-2 \left (a^2-3 b^2\right ) \log (a+b \sin (c+d x))+\frac {2 a (a-b) (a+b)}{a+b \sin (c+d x)}}{2 a^4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.36, size = 105, normalized size = 0.92
method | result | size |
derivativedivides | \(\frac {\frac {\left (a^{2}-3 b^{2}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{4}}-\frac {a^{2}-b^{2}}{a^{3} \left (a +b \sin \left (d x +c \right )\right )}-\frac {1}{2 a^{2} \sin \left (d x +c \right )^{2}}+\frac {\left (-a^{2}+3 b^{2}\right ) \ln \left (\sin \left (d x +c \right )\right )}{a^{4}}+\frac {2 b}{a^{3} \sin \left (d x +c \right )}}{d}\) | \(105\) |
default | \(\frac {\frac {\left (a^{2}-3 b^{2}\right ) \ln \left (a +b \sin \left (d x +c \right )\right )}{a^{4}}-\frac {a^{2}-b^{2}}{a^{3} \left (a +b \sin \left (d x +c \right )\right )}-\frac {1}{2 a^{2} \sin \left (d x +c \right )^{2}}+\frac {\left (-a^{2}+3 b^{2}\right ) \ln \left (\sin \left (d x +c \right )\right )}{a^{4}}+\frac {2 b}{a^{3} \sin \left (d x +c \right )}}{d}\) | \(105\) |
risch | \(-\frac {2 i \left (-3 i a b \,{\mathrm e}^{4 i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+3 i a b \,{\mathrm e}^{2 i \left (d x +c \right )}-4 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}+6 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-3 \,{\mathrm e}^{i \left (d x +c \right )} b^{2}+a^{2} {\mathrm e}^{5 i \left (d x +c \right )}+a^{2} {\mathrm e}^{i \left (d x +c \right )}\right )}{\left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2} \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}-b +2 i a \,{\mathrm e}^{i \left (d x +c \right )}\right ) d \,a^{3}}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right )}{a^{2} d}-\frac {3 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 i a \,{\mathrm e}^{i \left (d x +c \right )}}{b}-1\right ) b^{2}}{a^{4} d}-\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{a^{2} d}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right ) b^{2}}{a^{4} d}\) | \(282\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 116, normalized size = 1.02 \begin {gather*} \frac {\frac {3 \, a b \sin \left (d x + c\right ) - 2 \, {\left (a^{2} - 3 \, b^{2}\right )} \sin \left (d x + c\right )^{2} - a^{2}}{a^{3} b \sin \left (d x + c\right )^{3} + a^{4} \sin \left (d x + c\right )^{2}} + \frac {2 \, {\left (a^{2} - 3 \, b^{2}\right )} \log \left (b \sin \left (d x + c\right ) + a\right )}{a^{4}} - \frac {2 \, {\left (a^{2} - 3 \, b^{2}\right )} \log \left (\sin \left (d x + c\right )\right )}{a^{4}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 259 vs.
\(2 (112) = 224\).
time = 0.39, size = 259, normalized size = 2.27 \begin {gather*} -\frac {3 \, a^{2} b \sin \left (d x + c\right ) - 3 \, a^{3} + 6 \, a b^{2} + 2 \, {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, {\left (a^{3} - 3 \, a b^{2} - {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{2} b - 3 \, b^{3} - {\left (a^{2} b - 3 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (b \sin \left (d x + c\right ) + a\right ) - 2 \, {\left (a^{3} - 3 \, a b^{2} - {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{2} + {\left (a^{2} b - 3 \, b^{3} - {\left (a^{2} b - 3 \, b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )\right )} \log \left (-\frac {1}{2} \, \sin \left (d x + c\right )\right )}{2 \, {\left (a^{5} d \cos \left (d x + c\right )^{2} - a^{5} d + {\left (a^{4} b d \cos \left (d x + c\right )^{2} - a^{4} b d\right )} \sin \left (d x + c\right )\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cot ^{3}{\left (c + d x \right )}}{\left (a + b \sin {\left (c + d x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 5.94, size = 165, normalized size = 1.45 \begin {gather*} -\frac {\frac {2 \, {\left (a^{2} - 3 \, b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) \right |}\right )}{a^{4}} - \frac {2 \, {\left (a^{2} b - 3 \, b^{3}\right )} \log \left ({\left | b \sin \left (d x + c\right ) + a \right |}\right )}{a^{4} b} + \frac {2 \, {\left (a^{2} b \sin \left (d x + c\right ) - 3 \, b^{3} \sin \left (d x + c\right ) + 2 \, a^{3} - 4 \, a b^{2}\right )}}{{\left (b \sin \left (d x + c\right ) + a\right )} a^{4}} - \frac {3 \, a^{2} \sin \left (d x + c\right )^{2} - 9 \, b^{2} \sin \left (d x + c\right )^{2} + 4 \, a b \sin \left (d x + c\right ) - a^{2}}{a^{4} \sin \left (d x + c\right )^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.38, size = 235, normalized size = 2.06 \begin {gather*} \frac {b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{a^3\,d}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (\frac {a^2}{2}-8\,b^2\right )+\frac {a^2}{2}-\frac {4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (3\,a^2\,b-2\,b^3\right )}{a}-3\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (4\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+4\,a^4\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+8\,b\,a^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\right )}-\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a^2\,d}-\frac {\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2-3\,b^2\right )}{a^4\,d}+\frac {\ln \left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )\,\left (a^2-3\,b^2\right )}{a^4\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________